// 引入服务模块
const express = require("express");
// 创建服务对象
const app = express();

// 引入路由处理模块
const loginRouter = require("./modules/login");
const registerRouter = require("./modules/register");
const getuserRouter = require("./modules/getuser");

// 注册各种中间件
// app.use( express.static("./www") );
app.use( express.static("./webroot") );
app.use( express.urlencoded() );

// 注册路由功能
app.get("/login", loginRouter );
app.post("/register", registerRouter() );
app.get("/getuser", getuserRouter );

app.listen(3000, ()=>{
  console.log("服务器开启成功");
})